package com.server.pinggu.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.server.pinggu.mapper.SenStreetsMatchMapper;
import com.server.pinggu.domain.SenStreetsMatch;
import com.server.pinggu.service.ISenStreetsMatchService;

import java.util.List;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author ltao
 * @date 2022-10-23
 */
@Service
public class SenStreetsMatchServiceImpl extends ServiceImpl<SenStreetsMatchMapper, SenStreetsMatch> implements ISenStreetsMatchService {

    @Override
    public List<SenStreetsMatch> queryList(SenStreetsMatch senStreetsMatch) {
        LambdaQueryWrapper<SenStreetsMatch> lqw = Wrappers.lambdaQuery();
        if (senStreetsMatch.getStreetId() != null){
            lqw.eq(SenStreetsMatch::getStreetId ,senStreetsMatch.getStreetId());
        }
        if (senStreetsMatch.getJuweiId() != null){
            lqw.eq(SenStreetsMatch::getJuweiId ,senStreetsMatch.getJuweiId());
        }
        if (StringUtils.isNotBlank(senStreetsMatch.getJiedao())){
            lqw.eq(SenStreetsMatch::getJiedao ,senStreetsMatch.getJiedao());
        }
        if (StringUtils.isNotBlank(senStreetsMatch.getJuwei())){
            lqw.eq(SenStreetsMatch::getJuwei ,senStreetsMatch.getJuwei());
        }
        if (StringUtils.isNotBlank(senStreetsMatch.getLu())){
            lqw.eq(SenStreetsMatch::getLu ,senStreetsMatch.getLu());
        }
        if (StringUtils.isNotBlank(senStreetsMatch.getNong())){
            lqw.eq(SenStreetsMatch::getNong ,senStreetsMatch.getNong());
        }
        if (senStreetsMatch.getStart() != null){
            lqw.eq(SenStreetsMatch::getStart ,senStreetsMatch.getStart());
        }
        if (senStreetsMatch.getEnd() != null){
            lqw.eq(SenStreetsMatch::getEnd ,senStreetsMatch.getEnd());
        }
        if (senStreetsMatch.getDanshuang() != null){
            lqw.eq(SenStreetsMatch::getDanshuang ,senStreetsMatch.getDanshuang());
        }
        if (senStreetsMatch.getNongStart() != null){
            lqw.eq(SenStreetsMatch::getNongStart ,senStreetsMatch.getNongStart());
        }
        if (senStreetsMatch.getNongEnd() != null){
            lqw.eq(SenStreetsMatch::getNongEnd ,senStreetsMatch.getNongEnd());
        }
        return this.list(lqw);
    }
}